package com.sline.jdk5;

import java.util.ArrayList;

public class Demo1_Foreach {
    public static void main(String[] args) {
        int[] arr1 = {1, 2, 3, 3, 4};
        for (int i: arr1) {
            System.out.println(i);
        }

        ArrayList<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");

        
        for (String string : list) {
            System.out.println(string);
        }
    }
}
